All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.java.swing.text.StyleConstants
java.lang.Object
|
+----com.sun.java.swing.text.StyleConstants
- public class StyleConstants
- extends Object
A collection of well known or common attribute keys
and methods to apply to an AttributeSet or MutableAttributeSet
to get/set the properties in a typesafe manner.
The paragraph attributes form the definition of a paragraph to be rendered.
All sizes are specified in points (such as found in postscript), a
device independent measure.
-
ALIGN_CENTER
- A possible value for paragraph alignment.
-
ALIGN_JUSTIFIED
- A possible value for paragraph alignment.
-
ALIGN_LEFT
- A possible value for paragraph alignment.
-
ALIGN_RIGHT
- A possible value for paragraph alignment.
-
Alignment
- Alignment for the paragraph.
-
Background
- Name of the background color attribute.
-
Bold
- Name of the bold attribute.
-
ComponentAttribute
- Name of the component attribute.
-
ComponentElementName
- Name of elements used to represent components.
-
FirstLineIndent
- The amount of space to indent the first
line of the paragraph.
-
FontFamily
- Name of the font family.
-
FontSize
- Name of the font size.
-
Foreground
- Name of the foreground color attribute.
-
IconAttribute
- Name of the icon attribute.
-
IconElementName
- Name of elements used to represent icons.
-
Italic
- Name of the italic attribute.
-
LeftIndent
- The amount to indent the left side
of the paragraph.
-
LineSpacing
- The amount of space between lines
of the paragraph.
-
NameAttribute
- Attribute name used to name the collection of
attributes.
-
ResolveAttribute
- Attribute name used to identifiy the resolving parent
set of attributes, if one is defined.
-
RightIndent
- The amount to indent the right side
of the paragraph.
-
SpaceAbove
- The amount of space above the paragraph.
-
SpaceBelow
- The amount of space below the paragraph.
-
TabSet
- TabSet for the paragraph, type is a TabSet containing
TabStops.
-
Underline
- Name of the underline attribute.
-
getAlignment(AttributeSet)
- Gets the alignment setting.
-
getComponent(AttributeSet)
- Gets the component setting from the attribute list.
-
getFirstLineIndent(AttributeSet)
- Gets the first line indent setting.
-
getFontFamily(AttributeSet)
- Gets the font family setting from the attribute list.
-
getFontSize(AttributeSet)
- Gets the font size setting from the attribute list.
-
getForeground(AttributeSet)
- Gets the foreground color setting from the attribute list.
-
getIcon(AttributeSet)
- Gets the icon setting from the attribute list.
-
getLeftIndent(AttributeSet)
- Gets the left indent setting.
-
getLineSpacing(AttributeSet)
- Gets the line spacing setting.
-
getRightIndent(AttributeSet)
- Gets the right indent setting.
-
getSpaceAbove(AttributeSet)
- Gets the space above setting.
-
getSpaceBelow(AttributeSet)
- Gets the space below setting.
-
getTabSet(AttributeSet)
- Gets the TabSet.
-
isBold(AttributeSet)
- Checks whether the bold attribute is set.
-
isItalic(AttributeSet)
- Checks whether the italic attribute is set.
-
isUnderline(AttributeSet)
- Checks whether the underline attribute is set.
-
setAlignment(MutableAttributeSet, int)
- Sets alignment.
-
setBold(MutableAttributeSet, boolean)
- Sets the bold attribute.
-
setComponent(MutableAttributeSet, Component)
- Sets the component attribute.
-
setFirstLineIndent(MutableAttributeSet, float)
- Sets the first line indent.
-
setFontFamily(MutableAttributeSet, String)
- Sets the font attribute.
-
setFontSize(MutableAttributeSet, int)
- Sets the font size attribute.
-
setForeground(MutableAttributeSet, Color)
- Sets the foreground color.
-
setIcon(MutableAttributeSet, Icon)
- Sets the icon attribute.
-
setItalic(MutableAttributeSet, boolean)
- Sets the italic attribute.
-
setLeftIndent(MutableAttributeSet, float)
- Sets left indent.
-
setLineSpacing(MutableAttributeSet, float)
- Sets line spacing.
-
setRightIndent(MutableAttributeSet, float)
- Sets right indent.
-
setSpaceAbove(MutableAttributeSet, float)
- Sets space above.
-
setSpaceBelow(MutableAttributeSet, float)
- Sets space below.
-
setTabSet(MutableAttributeSet, TabSet)
- Sets the TabSet.
-
setUnderline(MutableAttributeSet, boolean)
- Sets the underline attribute.
-
toString()
- Returns the string representation.
ComponentElementName
public static final String ComponentElementName
- Name of elements used to represent components.
IconElementName
public static final String IconElementName
- Name of elements used to represent icons.
NameAttribute
public static final Object NameAttribute
- Attribute name used to name the collection of
attributes.
ResolveAttribute
public static final Object ResolveAttribute
- Attribute name used to identifiy the resolving parent
set of attributes, if one is defined.
FontFamily
public static final Object FontFamily
- Name of the font family.
FontSize
public static final Object FontSize
- Name of the font size.
Bold
public static final Object Bold
- Name of the bold attribute.
Italic
public static final Object Italic
- Name of the italic attribute.
Underline
public static final Object Underline
- Name of the underline attribute.
Foreground
public static final Object Foreground
- Name of the foreground color attribute.
Background
public static final Object Background
- Name of the background color attribute.
ComponentAttribute
public static final Object ComponentAttribute
- Name of the component attribute.
IconAttribute
public static final Object IconAttribute
- Name of the icon attribute.
FirstLineIndent
public static final Object FirstLineIndent
- The amount of space to indent the first
line of the paragraph. This value may be negative
to offset in the reverse direction. The type
is Float and specifies the size of the space
in points.
LeftIndent
public static final Object LeftIndent
- The amount to indent the left side
of the paragraph.
Type is float and specifies the size in points.
RightIndent
public static final Object RightIndent
- The amount to indent the right side
of the paragraph.
Type is float and specifies the size in points.
LineSpacing
public static final Object LineSpacing
- The amount of space between lines
of the paragraph.
Type is float and specifies the size in points.
SpaceAbove
public static final Object SpaceAbove
- The amount of space above the paragraph.
Type is float and specifies the size in points.
SpaceBelow
public static final Object SpaceBelow
- The amount of space below the paragraph.
Type is float and specifies the size in points.
Alignment
public static final Object Alignment
- Alignment for the paragraph. The type is
Integer. Valid values are:
- ALIGN_LEFT
- ALIGN_RIGHT
- ALIGN_CENTER
- ALIGN_JUSTIFED
TabSet
public static final Object TabSet
- TabSet for the paragraph, type is a TabSet containing
TabStops.
ALIGN_LEFT
public static final int ALIGN_LEFT
- A possible value for paragraph alignment. This
specifies that the text is aligned to the left
indent and extra whitespace should be placed on
the right.
ALIGN_CENTER
public static final int ALIGN_CENTER
- A possible value for paragraph alignment. This
specifies that the text is aligned to the center
and extra whitespace should be placed equally on
the left and right.
ALIGN_RIGHT
public static final int ALIGN_RIGHT
- A possible value for paragraph alignment. This
specifies that the text is aligned to the right
indent and extra whitespace should be placed on
the left.
ALIGN_JUSTIFIED
public static final int ALIGN_JUSTIFIED
- A possible value for paragraph alignment. This
specifies that extra whitespace should be spread
out through the rows of the paragraph with the
text lined up with the left and right indent
except on the last line which should be aligned
to the left.
toString
public String toString()
- Returns the string representation.
- Returns:
- the string
- Overrides:
- toString in class Object
getComponent
public static Component getComponent(AttributeSet a)
- Gets the component setting from the attribute list.
- Parameters:
- a - the attribute set
- Returns:
- the component, null if none
setComponent
public static void setComponent(MutableAttributeSet a,
Component c)
- Sets the component attribute.
- Parameters:
- a - the attribute set
- c - the component
getIcon
public static Icon getIcon(AttributeSet a)
- Gets the icon setting from the attribute list.
- Parameters:
- a - the attribute set
- Returns:
- the icon, null if none
setIcon
public static void setIcon(MutableAttributeSet a,
Icon c)
- Sets the icon attribute.
- Parameters:
- a - the attribute set
- c - the icon
getFontFamily
public static String getFontFamily(AttributeSet a)
- Gets the font family setting from the attribute list.
- Parameters:
- a - the attribute set
- Returns:
- the font family, "Monospaced" as the default
setFontFamily
public static void setFontFamily(MutableAttributeSet a,
String fam)
- Sets the font attribute.
- Parameters:
- a - the attribute set
- fam - the font
getFontSize
public static int getFontSize(AttributeSet a)
- Gets the font size setting from the attribute list.
- Parameters:
- a - the attribute set
- Returns:
- the font size, 12 as the default
setFontSize
public static void setFontSize(MutableAttributeSet a,
int s)
- Sets the font size attribute.
- Parameters:
- a - the attribute set
- s - the font size
isBold
public static boolean isBold(AttributeSet a)
- Checks whether the bold attribute is set.
- Parameters:
- a - the attribute set
- Returns:
- true if set else false
setBold
public static void setBold(MutableAttributeSet a,
boolean b)
- Sets the bold attribute.
- Parameters:
- a - the attribute set
- b - specifies true/false for setting the attribute
isItalic
public static boolean isItalic(AttributeSet a)
- Checks whether the italic attribute is set.
- Parameters:
- a - the attribute set
- Returns:
- true if set else false
setItalic
public static void setItalic(MutableAttributeSet a,
boolean b)
- Sets the italic attribute.
- Parameters:
- a - the attribute set
- b - specifies true/false for setting the attribute
isUnderline
public static boolean isUnderline(AttributeSet a)
- Checks whether the underline attribute is set.
- Parameters:
- a - the attribute set
- Returns:
- true if set else false
setUnderline
public static void setUnderline(MutableAttributeSet a,
boolean b)
- Sets the underline attribute.
- Parameters:
- a - the attribute set
- b - specifies true/false for setting the attribute
getForeground
public static Color getForeground(AttributeSet a)
- Gets the foreground color setting from the attribute list.
- Parameters:
- a - the attribute set
- Returns:
- the color, Color.black as the default
setForeground
public static void setForeground(MutableAttributeSet a,
Color fg)
- Sets the foreground color.
- Parameters:
- a - the attribute set
- fg - the color
getFirstLineIndent
public static float getFirstLineIndent(AttributeSet a)
- Gets the first line indent setting.
- Parameters:
- a - the attribute set
- Returns:
- s the value, 0 if not set
setFirstLineIndent
public static void setFirstLineIndent(MutableAttributeSet a,
float i)
- Sets the first line indent.
- Parameters:
- a - the attribute set
- i - the value
getRightIndent
public static float getRightIndent(AttributeSet a)
- Gets the right indent setting.
- Parameters:
- a - the attribute set
- Returns:
- s the value, 0 if not set
setRightIndent
public static void setRightIndent(MutableAttributeSet a,
float i)
- Sets right indent.
- Parameters:
- a - the attribute set
- i - the value
getLeftIndent
public static float getLeftIndent(AttributeSet a)
- Gets the left indent setting.
- Parameters:
- a - the attribute set
- Returns:
- s the value, 0 if not set
setLeftIndent
public static void setLeftIndent(MutableAttributeSet a,
float i)
- Sets left indent.
- Parameters:
- a - the attribute set
- i - the value
getLineSpacing
public static float getLineSpacing(AttributeSet a)
- Gets the line spacing setting.
- Parameters:
- a - the attribute set
- Returns:
- s the value, 0 if not set
setLineSpacing
public static void setLineSpacing(MutableAttributeSet a,
float i)
- Sets line spacing.
- Parameters:
- a - the attribute set
- i - the value
getSpaceAbove
public static float getSpaceAbove(AttributeSet a)
- Gets the space above setting.
- Parameters:
- a - the attribute set
- Returns:
- s the value, 0 if not set
setSpaceAbove
public static void setSpaceAbove(MutableAttributeSet a,
float i)
- Sets space above.
- Parameters:
- a - the attribute set
- i - the value
getSpaceBelow
public static float getSpaceBelow(AttributeSet a)
- Gets the space below setting.
- Parameters:
- a - the attribute set
- Returns:
- s the value, 0 if not set
setSpaceBelow
public static void setSpaceBelow(MutableAttributeSet a,
float i)
- Sets space below.
- Parameters:
- a - the attribute set
- i - the value
getAlignment
public static int getAlignment(AttributeSet a)
- Gets the alignment setting.
- Parameters:
- a - the attribute set
- Returns:
- s the value, StyleConstants.ALIGN_LEFT if not set
setAlignment
public static void setAlignment(MutableAttributeSet a,
int align)
- Sets alignment.
- Parameters:
- a - the attribute set
- align - the alignment value
getTabSet
public static TabSet getTabSet(AttributeSet a)
- Gets the TabSet.
- Parameters:
- a - the attribute set
- Returns:
- s the TabSet.
setTabSet
public static void setTabSet(MutableAttributeSet a,
TabSet tabs)
- Sets the TabSet.
- Parameters:
- a - the attribute set.
- tabs - the TabSet
All Packages Class Hierarchy This Package Previous Next Index